# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=apk-polkit-rs
pkgver=0.93.0
_gitlabsha=8db408efd47a08277c0a9b219d5c9200
pkgrel=2
pkgdesc="apk-polkit-rs exposes a DBus API for APK, the Alpine Package Keeper"
url="https://gitlab.alpinelinux.org/Cogitri/apk-polkit-rs"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"
license="GPL-3.0-or-later"
depends="polkit"
makedepends="meson cargo polkit-dev glib-dev lua5.3-lzlib lua5.3
	openssl1.1-compat-dev clang-dev"
checkdepends="appstream-glib bash apk-tools"
subpackages="$pkgname-dev $pkgname-dbg $pkgname-lang"
source="https://gitlab.alpinelinux.org/Cogitri/apk-polkit-rs/uploads/$_gitlabsha/apk-polkit-rs-$pkgver.tar.xz
	meson-0.60.patch
	"
options="!check" #https://gitlab.alpinelinux.org/Cogitri/apk-polkit-rs/-/issues/7 , fails with rust 1.55

build() {
	abuild-meson . output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	rm "$pkgdir"/usr/lib/libapk.a
}

sha512sums="
818e163a0e121acf887d4d15b986dd1cf13e49386453a120dc62ad8c45c5524cddac87fe6424bd8c2170dee39c43cf1a9721edd3265b619f74aec231eae27790  apk-polkit-rs-0.93.0.tar.xz
dd0f98d18e30136bc95b7b7beb93cdc31a008deaaa84be9418c14264d0ac657c7f8620cb81188eb323fb4697786386f6cb20c404da503c3fad5fdf9f36094e13  meson-0.60.patch
"
